package com.abel.web.validator;

import java.util.Calendar;

public class Tester {

	public void regexPeriod() {
		
		String str = "5.5";
		String splits[] = str.split("[.]");
		if (splits.length > 0) {
			System.out.println(splits[0]);
			System.out.println(splits[1]);
		}
		else {
			System.out.println("no splits" + splits.length);
		}
	}
	
	
	public void regexName() {
		String str = "Ma'Joseph X'avier c";
		
		if (str.matches("[a-zA-z]+([ '-][a-zA-Z]+)*")) {
			System.out.println("matches");
		}
		else {
			System.out.println("no match");
		}
	}
	
	public void testssn() {
		String str = "a";
		if (str.matches("[a-zA-Z]{1}")) {
			System.out.println("match");
		}
		else {
			System.out.println("does not match");
		}
	}
	
	
	public void testNumeric() {
		String str = "500000";
		if (str.matches("[0-9]*")) {
			System.out.println("match");
		}
		else {
			System.out.println("does not match");
		}
	}
	
	public void testCalendar(String dt) {
		
		Calendar cal = Calendar.getInstance();
		System.out.println(cal.getTime());
		cal.add(Calendar.DATE, -7);
		System.out.println(cal.getTime());
	}
	
	public static void main (String[] args) {
		Tester tester = new Tester();
		tester.testCalendar("01/01/2010");
	}
}
